package com.learning.algorithm;

import com.learning.algorithm.util.HanyuPinyinHelper;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: daqian_liao
 * @Date: 2018/12/12 20:26
 * @Version 1.0
 */
@Getter
@AllArgsConstructor
public class Word {
    private String chinese ;
    private String pinyin ;
    private String firstLetterPy ;

    public Word(String chinese) {
        this.chinese = chinese;
        this.pinyin = HanyuPinyinHelper.toHanyuPinyin(chinese);
        this.firstLetterPy = HanyuPinyinHelper.getFirstLettersLo(chinese);
    }

    @Override
    public String toString() {
        return "Word{" +
                "chinese='" + chinese + '\'' +
                ", pinyin='" + pinyin + '\'' +
                ", firstLetterPy='" + firstLetterPy + '\'' +
                '}';
    }
}
